<?php
class index_Controller extends MY_Controller{
    function __construct(){
        parent::__construct();
        //Load view Default or Set Css, Set Script.....
        //Use for Home Page.        
        $this->load->helper('form');
		$this->load->helper('url');
		$this->load->helper('bodau');
        $this->load->library('parser');
        $this->load->library('theme');
		$this->load->library('index_user');        
        $this->theme->set_template('templates/index_template');
        $this->header();        
        $this->footer();
    }   
	function header(){
		if($this->uri->segment(2)=="listgame"){
			$this->session->set_userdata('catId',cut_link($this->uri->segment(3)));
		}else{
			if($this->uri->segment(2)!="playgame"){
				$this->session->unset_userdata('catId');
			}	
		}
		
		$this->load->model('category_model','cat',TRUE);
		$data['cats']=$this->cat->getCat();
		$this->theme->set_widget('common/header','header',$data);
	} 
	function footer(){
		$this->load->model('category_model','cat',TRUE);
		$data['cats']=$this->cat->getCat();
		$this->theme->set_widget('common/footer','footer',$data);
	}
}
?>

